<?
if(!MEMBER) common::accessdenied();
$owner = photos::get(array('owner'=>true, 'ID'=>PARAMS));
$data->settings = account::settings($owner);
if(POST) {
    /*if($_POST['CID'])
        photos::comment(array('accountID'=>UID,'photoID'=>$_POST['PID'],'comment'=>$_POST['comment']));
    else*/
        if(!$data->settings->photos || $data->settings->photos->comment)
        photos::comment(array('senderID'=>UID,'itemID'=>$_POST['PID'],'comment'=>$_POST['comment']));
} 
if(PARAMS){
    $data->photo = photos::get(array('photo'=>true,'ID'=>PARAMS));
    $data->postie->comments = @array_reverse(comment::thread(array('app'=>'photos','itemID'=>PARAMS)));
}

$data->TITLE = $data->photo->caption?$data->photo->caption:_('Content not found');
$data->DESCRIPTION = $data->photo->caption?_('Photos.'):_('This content is currently unavailable');

$data->CSS = 'postie';
?>